//引入项目中全部的全局组件
import SvgIcon from "./SvgIcon/index.vue";
import SearchComp from "./SearchComp/index.vue";
import Pagination from "./Pagination/index.vue";
import Drawer from "./Drawer/index.vue";
import PopupTreeInput from "./PopupTreeInput/index.vue";
import UploadComp from "./Upload/index.vue";
// 如果您正在使用CDN引入，请删除下面一行。
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
//全局对象
const allGloablComponent: any = {
  SvgIcon,
  SearchComp,
  Pagination,
  Drawer,
  PopupTreeInput,
  UploadComp,
};
//对外暴露插件对象
export default {
  install(app: any) {
    //注册项目全部的全局组件
    Object.keys(allGloablComponent).forEach((key) => {
      //注册为全局组件
      app.component(key, allGloablComponent[key]);
    });
    //将element-plus提供的图标注册为全局组件
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component);
    }
  },
};
